package com.isman.placeslist.util;
import java.util.List;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapController;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class GeoUpdateHandler implements LocationListener {
	@SuppressWarnings("unused")
	private List<Overlay> mapOverlays;
	@SuppressWarnings("unused")
	private MapController mapController;
	@SuppressWarnings("unused")
	private Context mContext;
	@SuppressWarnings("unused")
	private Drawable mIcon;
	
	public GeoUpdateHandler(Context mContext, 
							final List<Overlay> mapOverlays, 
							final MapController mapController, 
							Drawable mIcon){
		
		this.mapOverlays = mapOverlays;
		this.mapController = mapController;
		this.mContext = mContext;
		this.mIcon	 = mIcon;
	}

	@Override
	public void onLocationChanged(Location location) {
//		HotelItemizedOverlay itemizedoverlay = new HotelItemizedOverlay(mIcon, mContext);
		
		int lat = (int) (location.getLatitude() * 1E6);
		int lng = (int) (location.getLongitude() * 1E6);
		GeoPoint point = new GeoPoint(lat, lng);
		@SuppressWarnings("unused")
		OverlayItem overlayitem = new OverlayItem(point, "Sekai, konichiwa!", "I'm in Japan!");
		
//		Hotel m = new Hotel();
//		m.setHotelID(-1);
//		itemizedoverlay.addOverlay(overlayitem, m);
//		mapOverlays.add(itemizedoverlay);
//		mapController.animateTo(point);
	}

	@Override
	public void onProviderDisabled(String provider) {
	}

	@Override
	public void onProviderEnabled(String provider) {
	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
	}
}

